package org.jeecg.modules.demo.evaluate.service.impl;

import com.baomidou.dynamic.datasource.annotation.DS;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.jeecg.modules.demo.evaluate.entity.Evaluate;
import org.jeecg.modules.demo.evaluate.entity.TraderE;
import org.jeecg.modules.demo.evaluate.mapper.EvaluateMapper;
import org.jeecg.modules.demo.evaluate.service.IEvaluateService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class EvaluateServiceImpl extends ServiceImpl<EvaluateMapper, Evaluate> implements IEvaluateService {


    @Autowired
    private EvaluateMapper evaluateMapper;

    public Evaluate getByTraderid(Integer traderid){
        return evaluateMapper.getByTraderid(traderid);
    }

    @DS("multi-datasource1")
    public List<TraderE> getTraderElist(Page<TraderE> page, QueryWrapper<TraderE> queryWrapper){
        return evaluateMapper.getTraderElist(page, queryWrapper);
    }

    public String getTotalscoreBytraderid(Integer traderid){
        return evaluateMapper.getTotalscoreBytraderid(traderid);
    }

}
